<h1><code ng:non-bindable="">$exceptionHandlerProvider</code>
<span class="hint">(service in module <code ng:non-bindable="">ngMock</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Configures the mock implementation of <a href="api/ng.$exceptionHandler"><code>ng.$exceptionHandler</code></a> to rethrow or to log errors passed
into the <code>$exceptionHandler</code>.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="mode">mode(mode)</h3>
<div class="mode"><p>Sets the logging mode.</p><h5 id="parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>mode</td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><p>Mode of operation, defaults to <code>rethrow</code>.</p>

<ul>
<li><code>rethrow</code>: If any errors are passed into the handler in tests, it typically
           means that there is a bug in the application or test, so this mock will
           make these tests fail.</li>
<li><code>log</code>: Sometimes it is desirable to test that an error is thrown, for this case the <code>log</code> mode stores an
       array of errors in <code>$exceptionHandler.errors</code>, to allow later assertion of them.
       See <a href="api/ngMock.$log#assertEmpty">assertEmpty()</a> and
        <a href="api/ngMock.$log#reset">reset()</a></li>
</ul></td></tr></tbody></table></div>
</li>
</ul>
</div>
</div>
